﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="NavigationPane" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Test.MainWindow"
        Title="MainWindow" Height="350" Width="525">
	<Window.Resources>
        <XmlDataProvider x:Key="XMLFile1DataSource" Source="D:\Lavori\CodePlex\Controls\SteMaCotrols\Test\XMLFile1.xml" d:IsDataSource="True"/>

		<DataTemplate x:Key="DataTemplate1">
			<TextBlock Text="{Binding XPath=@name}"></TextBlock>
		</DataTemplate>
		<DataTemplate x:Key="DataTemplate2">
			<StackPanel>
				<TextBlock Text="{Binding XPath=@name}"></TextBlock>
				<ListBox ItemsSource="{Binding XPath=subsection}" ItemTemplate="{DynamicResource DataTemplate3}">
				</ListBox>
			</StackPanel>
		</DataTemplate>
		<DataTemplate x:Key="DataTemplate3">
			<TextBlock Text="{Binding XPath=@name}"/>
		</DataTemplate>

	</Window.Resources>
    <Grid DataContext="{Binding Source={StaticResource XMLFile1DataSource}}">
    	<!--
		<s:NavigationPane HorizontalAlignment="Left" Width="216" >
			<s:NavigationPaneItem Header="stefano" />			-->
			<s:NavigationPane HorizontalAlignment="Left" Width="216" ItemsSource="{Binding XPath=/workflow/section}" ItemTemplate="{DynamicResource DataTemplate1}" ContentTemplate="{DynamicResource DataTemplate2}">

		</s:NavigationPane>
    </Grid>
</Window>
